package com.dianping.cat.home.storage.alert.entity;

import com.dianping.cat.home.storage.alert.BaseEntity;
import com.dianping.cat.home.storage.alert.IVisitor;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;





public class StorageAlertInfo
  extends BaseEntity<StorageAlertInfo>
{
  private String m_id;
  private Date m_startTime;
  private Date m_endTime;
/*  19 */   private Map<String, Storage> m_storages = new LinkedHashMap();





  public StorageAlertInfo(String id) { this.m_id = id; }




/*  30 */   public void accept(IVisitor visitor) { visitor.visitStorageAlertInfo(this); }


  public StorageAlertInfo addStorage(Storage storage) {
/*  34 */     this.m_storages.put(storage.getId(), storage);
/*  35 */     return this;
  }


  public boolean equals(Object obj) {
/*  40 */     if (obj instanceof StorageAlertInfo) {
/*  41 */       StorageAlertInfo _o = (StorageAlertInfo)obj;

/*  43 */       if (!equals(getId(), _o.getId())) {
/*  44 */         return false;
      }

/*  47 */       return true;
    }

/*  50 */     return false;
  }


/*  54 */   public Storage findStorage(String id) { return (Storage)this.m_storages.get(id); }


  public Storage findOrCreateStorage(String id) {
/*  58 */     Storage storage = (Storage)this.m_storages.get(id);

/*  60 */     if (storage == null) {
/*  61 */       synchronized (this.m_storages) {
/*  62 */         storage = (Storage)this.m_storages.get(id);

/*  64 */         if (storage == null) {
/*  65 */           storage = new Storage(id);
/*  66 */           this.m_storages.put(id, storage);
        }
      }
    }

/*  71 */     return storage;
  }


/*  75 */   public Date getEndTime() { return this.m_endTime; }



/*  79 */   public String getId() { return this.m_id; }



/*  83 */   public Date getStartTime() { return this.m_startTime; }



/*  87 */   public Map<String, Storage> getStorages() { return this.m_storages; }



  public int hashCode() {
/*  92 */     int hash = 0;

/*  94 */     return hash * 31 + ((this.m_id == null) ? 0 : this.m_id.hashCode());
  }




  public void mergeAttributes(StorageAlertInfo other) {
/* 101 */     assertAttributeEquals(other, "storage-alert-info", "id", this.m_id, other.getId());

/* 103 */     if (other.getStartTime() != null) {
/* 104 */       this.m_startTime = other.getStartTime();
    }

/* 107 */     if (other.getEndTime() != null) {
/* 108 */       this.m_endTime = other.getEndTime();
    }
  }


/* 113 */   public Storage removeStorage(String id) { return (Storage)this.m_storages.remove(id); }


  public StorageAlertInfo setEndTime(Date endTime) {
/* 117 */     this.m_endTime = endTime;
/* 118 */     return this;
  }

  public StorageAlertInfo setId(String id) {
/* 122 */     this.m_id = id;
/* 123 */     return this;
  }

  public StorageAlertInfo setStartTime(Date startTime) {
/* 127 */     this.m_startTime = startTime;
/* 128 */     return this;
  }

  public StorageAlertInfo() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/classes/!/com/dianping/cat/home/storage/alert/entity/StorageAlertInfo.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */